public class Test {
    public static void main(String[] args) {
        //创建对象
        Dog d = new Dog("小狗", 1);
        System.out.println(d.getName() + "," + d.getAge());

        d.eat();
        d.swim();
        System.out.println("-------------");

        Rabbit r = new Rabbit("小兔", 2);
        System.out.println(r.getName() + "," + r.getAge());
        r.eat();
        System.out.printf("--------------");

        Frog f = new Frog("小蛙", 3);
        System.out.println(f.getName() + "," + f.getAge());
        f.eat();
        f.swim();
    }
}
